
package com.ng.common.log.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ng.common.log.dao.DownLogDao;
import com.ng.common.log.dao.PreViewLogDao;
import com.ng.common.log.entity.PreViewEntity;
import com.ng.common.log.entity.ViewDownloadEntity;
import com.ng.common.log.service.DownLogService;
import com.ng.common.log.service.PreViewLogService;
import com.ng.common.utils.PageUtils;
import com.ng.common.utils.Query;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service
public class PreViewLogServiceImpl extends ServiceImpl<PreViewLogDao, PreViewEntity> implements PreViewLogService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = (String)params.get("key");
 
         
        
        IPage<PreViewEntity> page = this.page(
            new Query<PreViewEntity>(params).getPage(),
           // pageI,
            new QueryWrapper<PreViewEntity>().like(StringUtils.isNotBlank(key),"username", key)
            
            .orderByDesc("create_time")
        );

        return new PageUtils(page);
    }
}
